Adds a typed `resources_metadata` field to the bundle deploy telemetry
event, capturing per resource type:
- count of resources declared in the bundle configuration (replacing the
deprecated DatabricksBundleDeployEvent.resource_*_count fields, still
populated during the transition)
- max / mean / median state size in bytes across resources of that type
plus the whole simulated state file size and the effective deploy engine
("direct" or "terraform").
State sizes are computed from the bundle configuration, not by reading the
on-disk state file. Each resource's typed config is run through the direct
engine's adapter.PrepareState -- the same transformation direct uses to
derive the value it persists to resources.json -- and marshaled with the
indented encoding dstate.SaveState uses. Two consequences:
- the numbers are engine-independent, so direct and terraform deploys of the
same logical bundle report identical sizes (tfstate is never read);
- for direct deploys each per-resource size equals len(entry.State) on disk
byte-for-byte, and the file size matches resources.json up to the
Lineage/Serial fields.
The feature is one isolated module (bundle/phases/resources_metadata.go) plus
one line at the telemetry-emission call site. Telemetry never fails a deploy:
all parse/adapter errors are logged at debug level and treated as missing
data.
The universe proto (DatabricksBundleDeployEvent.resources_metadata,
BundleResourcesMetadata, ResourceMetadata) already exists, so this is ingested
rather than dropped.
Co-authored-by: Isaac
This PR adds tracking for state file sizes per resources we'll see in DMS. This is important to know - to design and prioritize work to integrate with UC internal storate as a overflow mechanism for DMS state.